{include file="common/head_exit"}
<style>
    .user_post {
        overflow: hidden;
        zoom: 1;
        margin-top: 10%;
        background: aliceblue;
    }

    .user_body {
        padding: 3%;
    }

    .user_head img {
        float: left;
        height: 60px;
        width: 60px;
    }

    .user_sign {
        float: left;
        width: 70%;
        margin-left: 5%;
    }

    .user_time {
        margin-top: 13px;
        display: block;
        font-size: 0.5em;
    }

    .user_text {
        width: 103%;
        margin-top: 15px;
        float: left;
        letter-spacing: 1px;
    }

    .user_span {
        float: left;
        width: 100%;
        margin-top: 16px;
        height: 30px;
        border-top: 1px solid gray;
        padding-top: 5px;
    }

    .user_span span {
        width: 32%;
        text-align: center;
    }

    .post1 {
        position: fixed;
        bottom: 0;
    }

    /* 評論 */

    .user_sign_l {
        float: left;
        width: 70%;
        margin-left: 5%;
    }

    .user_time_l {
        margin-top: 10px;
        display: block;
        font-size: 0.5em;
    }

    .user_text_l {
        margin-top: 20px;
        float: left;
        letter-spacing: 1px;
    }

    .user_post {
        overflow: hidden;
        zoom: 1;
        margin-top: 1%;
        background: aliceblue;
    }

    .user_body_l {
        overflow: hidden;
        zoom: 1;
        padding: 3%;
    }

    .user_head_l img {
        float: left;
        height: 50px;
        width: 50px;
    }
</style>

<body style="background:#f3f5f7">
    {volist name="list" id="vo"}
    <input type="hidden" id="page_id" value="{$vo.page_id}">
    <div class="user_post">
        <div class="user_body">
            <div class="user_head">
                <img src="/meetTWO/public/static/picture/pucture/userHeadImg/{$vo.Number}/img.jpg" onerror ="javascript:this.src='/meetTWO/public/static/picture/defaultHead.jpg';" alt="">
                <div class="user_sign">
                    <span>{$vo.user}</span>
                    <br>
                    <span class="user_time">{$vo.page_time}</span>
                </div>
            </div>
            <div class="user_text">
                {$vo.page_content}
            </div>
            <div class="user_foot">
                <div class="li-info user_span">
                    <span class="glyphicon glyphicon-comment">&nbsp{$vo.comment_num}</span>
                    <span class="glyphicon glyphicon-eye-open">&nbsp{$vo.view_num}</span>
                    <span class="glyphicon glyphicon-thumbs-up">&nbsp{$vo.user_id}</span>
                </div>
            </div>
        </div>
    </div>
    {/volist}
    <!-- 評論 -->

    {volist name="comment" id="vo"}
    <div class="user_body_l">
        <div class="user_head_l">
            <img src="/meetTWO/public/static/picture/pucture/userHeadImg/{$vo.Number}/img.jpg" onerror ="javascript:this.src='/meetTWO/public/static/picture/defaultHead.jpg';" alt="">
            <div class="user_sign_l">
                <span>{$vo.user}</span>
                <br>
                <span class="user_time_l">{$vo.comment_time}</span>
            </div>
        </div>
        <div class="user_text_l">
            {$vo.comment_content}
        </div>
    </div>
    {/volist}
    <br />
    <br />
    <br />

    <div class="col-lg-6 post1">
        <div class="input-group">
            <input type="text" class="form-control" id="comment" placeholder="输入你想评论的内容">
            <span class="input-group-btn">
                <button class="btn btn-default" id="commit_submmit" type="button">发送</button>
            </span>
        </div>
    </div>
</body>
<script>
    $("#commit_submmit").click(function () {
        $.get('/meetTWO/public/index/discussion/addcomment', { comment: $('#comment')[0].value,id:getCookie('number'),page_id:$('#page_id')[0].value }, function (data) {
            if(data==1){
                alert("评论发表成功")
            }else{
                alert("网络错误")
            }
        })
        console.log($('#comment')[0].value)
    })



    function getCookie(name) {
        var strcookie = document.cookie;//获取cookie字符串
        var arrcookie = strcookie.split("; ");//分割
        //遍历匹配
        for (var i = 0; i < arrcookie.length; i++) {
            var arr = arrcookie[i].split("=");
            if (arr[0] == name) {
                return arr[1];
            }
        }
        return "";
    }
</script>